<?php

namespace app\common\model;

use think\Model;
use think\Db;

/**
 * 单页模型
 */
class Page extends Model
{
    public static function getPagesByCategoryName($categoryName){
        $res = Db::name('page')
            ->alias('p')
            ->join('category c','p.category_id = c.id','LEFT')
            ->where(['c.name' => $categoryName])

             ->value('p.content');
//            ->find();
        return $res;
    }
}